import java.util.Scanner;

public class Ex2_5{
	public static void main(String[] args){
		System.out.print("Enter the subtotal and a gratuity rate: ");
		Scanner input = new Scanner(System.in);
		double subtotal = input.nextDouble();
		double gratuityRate= input.nextDouble();
		double gratuity = subtotal * gratuityRate / 100;
		double total = subtotal + gratuity;
		gratuity = (int)(gratuity * 100) / 100.0;
		total = (int)(total * 100) / 100.0;
		System.out.println("The gratuity is " + gratuity + 
			" and total is " + total);
	}
}